<!DOCTYPE html>
<html>
<head>
    <title>Upload Image</title>
</head>
<body>
<form id="form">
    <input type="file" id="file" name="file">
    <button type="button" onclick="upload()">Upload</button>
    <input type="text" id="t">
    <button type="button" onclick="getItem()">getItem</button>
    <img src="" id="img">
<!--    <video controls="" autoplay="" name="media">-->
<!--        <source id="med" src="" type="video/mp4">-->
<!--    </video>-->
</form>

<script>
    function getItem() {
        var file = document.getElementById("file").files[0];
        var name = document.getElementById("t").value;
        var formData = new FormData();
        var xhr = new XMLHttpRequest();
        xhr.open("GET", "http://localhost:8080/file/get?path=" + name);
        xhr.Param
        xhr.responseType = "blob";
        xhr.send();
    }

    function upload() {
        var file = document.getElementById("file").files[0];
        var formData = new FormData();
        formData.append("file", file);
        var xhr = new XMLHttpRequest();
        var xhr = new XMLHttpRequest();
        var img = document.getElementById("img");
        img.src = "E:\\FD\\X-YTM-001-144\\桜桃喵 - NO.130 长发蕾姆01 [45P-685MB]\\16";
        xhr.open("POST", "http://localhost:8080/file/upload");
        xhr.send(formData);
    }
</script>
</body>
</html>